package malus.shaofeng.com.beiwomusic.model;

import com.lidroid.xutils.db.annotation.Column;
import com.lidroid.xutils.db.annotation.Id;
import com.lidroid.xutils.db.annotation.NoAutoIncrement;
import com.lidroid.xutils.db.annotation.Table;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;

/**
 * Created by aaa on 15-3-10.
 */
@Table(name = "user")
public class User implements Serializable{
                @Id(column = "user_id")
                @NoAutoIncrement
                private long user_id;// 154429,
                @Column(column = "nickname")
                private String nickname;// "刘苏",
                @Column(column = "sex")
                private int sex;// 1,
                @Column(column = "face_uri")
                private String face_uri;// "/mnt/res.nmting.com/res/qms/20150310/jpg/f2/45/f2457912b9e04cf7ba0ff41977d3ceb0.jpg"

                public void parseJSON(JSONObject json){
                    if (json!=null){
                        user_id=json.optLong("user_id");
                        nickname=json.optString("nickname");
                        sex=json.optInt("sex");
                        face_uri=json.optString("face_uri");
                    }
                }

    public long getUser_id() {
        return user_id;
    }

    public void setUser_id(long user_id) {
        this.user_id = user_id;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public String getFace_uri() {
        return face_uri;
    }

    public void setFace_uri(String face_uri) {
        this.face_uri = face_uri;
    }
}
